-- GENERATED SPELL FOR [Qiraji Brainwasher] --


function spell0_15247(pUnit, Event) --@Cause Insanity,n/a--
pUnit:FullCastSpellOnTarget(26079,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15247', 10263, 1)
end

function spell1_15247(pUnit, Event) --@Mana Burn,Self--
pUnit:FullCastSpellOnTarget(26046,pUnit)
pUnit:RegisterEvent('Sorts_15247', 596, 1)
end

function spell2_15247(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(26044,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15247', 8000, 1)
end

function Sorts_15247(pUnit, Event)
local choix_sorts_15247 = math.random(0, 2)
if choix_sorts_15247 == 0 then
pUnit:RegisterEvent('spell0_15247', 1, 1)
end
if choix_sorts_15247 == 1 then
pUnit:RegisterEvent('spell1_15247', 1, 1)
end
if choix_sorts_15247 == 2 then
pUnit:RegisterEvent('spell2_15247', 1, 1)
end
end

function mob15247_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15247', math.random(1500, 3000), 1)
end

function mob15247_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15247_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15247_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15247, 1, 'mob15247_Action')
RegisterUnitEvent(15247, 2, 'mob15247_Leave')
RegisterUnitEvent(15247, 3, 'mob15247_Kill')
RegisterUnitEvent(15247, 4, 'mob15247_Die')
